package com.video.system.service.impl;

import java.util.List;
import com.video.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.video.system.mapper.VideoEducationMapper;
import com.video.system.domain.VideoEducation;
import com.video.system.service.IVideoEducationService;
import com.video.common.core.text.Convert;

/**
 * 学历Service业务层处理
 * 
 * @author lyh
 * @date 2021-07-20
 */
@Service
public class VideoEducationServiceImpl implements IVideoEducationService 
{
    @Autowired
    private VideoEducationMapper videoEducationMapper;

    /**
     * 查询学历编码和名称
     * @return
     */
    @Override
    public List<VideoEducation> selectCodeAndNameAll() {
        return videoEducationMapper.selectCodeAndNameAll();
    }

    /**
     * 查询学历
     * 
     * @param educationId 学历ID
     * @return 学历
     */
    @Override
    public VideoEducation selectVideoEducationById(Integer educationId)
    {
        return videoEducationMapper.selectVideoEducationById(educationId);
    }

    /**
     * 查询学历列表
     * 
     * @param videoEducation 学历
     * @return 学历
     */
    @Override
    public List<VideoEducation> selectVideoEducationList(VideoEducation videoEducation)
    {
        return videoEducationMapper.selectVideoEducationList(videoEducation);
    }

    /**
     * 新增学历
     * 
     * @param videoEducation 学历
     * @return 结果
     */
    @Override
    public int insertVideoEducation(VideoEducation videoEducation)
    {
        videoEducation.setCreateTime(DateUtils.getNowDate());
        return videoEducationMapper.insertVideoEducation(videoEducation);
    }

    /**
     * 修改学历
     * 
     * @param videoEducation 学历
     * @return 结果
     */
    @Override
    public int updateVideoEducation(VideoEducation videoEducation)
    {
        videoEducation.setUpdateTime(DateUtils.getNowDate());
        return videoEducationMapper.updateVideoEducation(videoEducation);
    }

    /**
     * 删除学历对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVideoEducationByIds(String ids)
    {
        return videoEducationMapper.deleteVideoEducationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学历信息
     * 
     * @param educationId 学历ID
     * @return 结果
     */
    @Override
    public int deleteVideoEducationById(Integer educationId)
    {
        return videoEducationMapper.deleteVideoEducationById(educationId);
    }
}
